home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / NULLIFY.HDR < prev    next >
Text File  |  1994-04-25  |  3KB  |  74 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _Nullify( cFunctionRetVal, cRetType ) --> xValue
  8.  
  9. PARAMETERS:
  10.  
  11. cFunctionRetVal: The function call, with parameters, to execute
  12. cRetType       : Return Value type.
  13.  
  14. SHORT:
  15.  
  16. Nullify an expression of any type in-line.
  17.  
  18. DESCRIPTION:
  19.  
  20. _Nullify() accepts a function call as it's first parameter, and returns
  21. an empty value of the type specified in cRetType.
  22.  
  23. The basic purpose of this function is to allow you to concatenate
  24. several function calls together in a single expression without having
  25. to reconcile the different data types that those functions may return.
  26.  
  27. _Nullify(INKEY(100),"C")
  28.          |        |  |-------The Return Value Type (Char if NIL)
  29.            --------
  30.               |------------The Embedded Function
  31.  
  32. _Nullify() nullifies any other function in an in-line expression by
  33. calling that function, and accepting it's return value as it own
  34. first parameter.  This function's return value is instead ignored, and
  35. the SECOND parameter to _Nullify() specifies what sort of empty/nil value
  36. to return.
  37.  
  38. "C" returns '',  "N" returns 0
  39.  
  40. If cRetType is not specified at all (i.e., NIL) then "" is returned
  41. by default.  If an invalid (not C or N) is specified, then the return value
  42. is an empty character type ("").
  43.  
  44. Note that "_X()" is a pseudonym that may be used in place of "_Nullify()",
  45. and "_Nulify()" is an alternate spelling.  They perform the same task, but in
  46. places where space is at a premium (ie, in the _KMenu() Menu System where the
  47. menu allows only so many keystrokes in any given field), _X() may save you
  48. some worthy space.
  49.  
  50. NOTE:
  51.  
  52.  
  53.  
  54. EXAMPLE:
  55.  
  56. This function does nothing other than allow me to do inline nulification
  57. of other function's return values.  This allows me to, say, add a pause into
  58. a dial string:
  59.  
  60. ATDT1800555-1212 + _Nullify(inkey(3)) + '372* 886#'
  61.  
  62. It can also allow you to make two function calls in a single expression
  63. (such as, for example, the PREFUNC field in the _KMENU system) (Using the
  64. _X() pseudonym):
  65.  
  66. _X( 'TONE(1000,3)', "C" )+_Nulify( '_Msg("Wrong Answer!")', "C" )
  67.  
  68. In this case, a beep will sound, followed by the Message "Wrong Answer", even
  69. though the two functions that did this return different values.  The
  70. _Nullify() function returns a "" for each function allowing them to be
  71. combined with the "+" operator.
  72.  
  73. ******************************************************************************/
  74.